package com.server.modules.api.service;

import com.server.modules.api.dao.TagAPIDao;
import com.server.modules.api.vo.MemberVo;
import com.server.modules.sys.entity.loan.Loan;
import com.server.modules.sys.entity.member.Member;
import com.server.modules.sys.entity.tag.Tag;
import com.server.modules.sys.service.tag.TagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author SilentWolf
 * @Date 2016/8/16 15:47
 */
@Service
public class TagAPIService extends TagService {
	@Autowired
	public   TagAPIDao tagAPIDao;
	public List<Tag> selectTagsByLoan(Loan loan) {
		return tagAPIDao.selectTagsByLoan( loan);
	}

	public List<Tag> selectTagsByMember(Member member) {
		return tagAPIDao.selectTagsByMember( member);
	}

	public List<Tag> selectAllTags(){
		return  tagAPIDao.selectAllTags();
	}

	@Transactional(readOnly = false)
	public int deleteByMemberId(String memberId){
		return tagAPIDao.deleteByMemberId(memberId);
	}

	@Transactional(readOnly = false)
	public int updateMemberTags(MemberVo vo){
		return  tagAPIDao.updateMemberTags(vo);
	}
}
